#include<bits/stdc++.h>
using namespace std;

const int N=102;
const int mod=1e6+7;
int n,m;
int c[N];
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) scanf("%d",&c[i]);
    int pre[N],cur[N];
    memset(cur,0,sizeof(cur));
    cur[0]=1;
	for(int k=1;k<=n;k++){
		for(int i=0;i<=m;i++){
	        pre[i]=cur[i];
	    }
		memset(cur,0,sizeof(cur));
	    for(int i=m;i>=0;i--){
	        for(int j=max(0,i-c[k]);j<=i;j++){
	            cur[i]=(cur[i]+pre[j])%mod;
	        }
	    }
	}
    printf("%d",cur[m]);
    return 0;
}
